package com.ssy.lingxi.order.controller.platform;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.order.model.vo.platform.request.PlatformOrderHistoryPageVO;
import com.ssy.lingxi.order.model.vo.platform.response.PlatformOrderInnerHistoryVO;
import com.ssy.lingxi.order.model.vo.platform.response.PlatformOrderOuterHistoryVO;
import com.ssy.lingxi.order.service.platform.IPlatformOrderHistoryService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu 平台后台 - 订单历史记录查询相关接口
 * @author 万宁
 * @version 2.0.0
 * @date 2021-12-04
 */
@RestController
@RequestMapping("/order/platform/history")
public class PlatformOrderHistoryController {
    @Resource
    private IPlatformOrderHistoryService platformOrderHistoryService;

    /**
     * 分页查询订单外部历史记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/outer/page", method = RequestMethod.GET)
    public Wrapper<PageData<PlatformOrderOuterHistoryVO>> pageOrderOuterHistories(@RequestHeader HttpHeaders headers, @Valid PlatformOrderHistoryPageVO pageVO) {
        return platformOrderHistoryService.pageOrderOuterHistories(headers, pageVO);
    }

    /**
     * 分页查询订单内部历史记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/inner/page", method = RequestMethod.GET)
    public Wrapper<PageData<PlatformOrderInnerHistoryVO>> pageOrderInnerHistories(@RequestHeader HttpHeaders headers, @Valid PlatformOrderHistoryPageVO pageVO) {
        return platformOrderHistoryService.pageOrderInnerHistories(headers, pageVO);
    }
}
